package com.tan00xu.controller;

import com.tan00xu.service.LoginService;
import com.tan00xu.utils.CmdOutputInformationUtils;
import com.tan00xu.vo.Result;
import com.tan00xu.vo.params.LoginParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class RegisterController {

    @Autowired
    private LoginService loginService;

    /**
     * 用户注册
     * @param loginParam 用户注册信息（账号，密码，昵称）
     * @return
     */
    @PostMapping("/register")
    public Result register(@RequestBody LoginParam loginParam) {
        CmdOutputInformationUtils.info("RegisterController下的register被请求了=>用户注册");
        return loginService.register(loginParam);
    }
}
